﻿Imports System.ComponentModel
Imports FountainHead.ViewModel.Controls
Imports FountainHead.ViewModel.Interfaces

Namespace Properties

    <DefaultPropertyAttribute("Text"), _
DescriptionAttribute("Control Properties")> _
    Public Class SourceControlProperties
        Inherits BaseProperties
        Public Sub New()

        End Sub
        Public Sub New(ByVal vm As SourceControlViewModel)
            MyBase.new(vm)
            viewModelValue = vm
        End Sub

        Public Shared SourceProperty As New SourceControlProperties()

#Region "Properties"
        Private viewModelValue As SourceControlViewModel
        Public Overloads Property ViewModel() As SourceControlViewModel
            Get
                Return viewModelValue
            End Get
            Set(ByVal value As SourceControlViewModel)
                viewModelValue = value
                MyBase.ViewModel = value
            End Set
        End Property

        <CategoryAttribute("Control"), _
           Browsable(True), _
           [ReadOnly](False), _
           BindableAttribute(False), _
           DefaultValueAttribute(""), _
           DesignOnly(False), _
           DescriptionAttribute("Enter the voltage")> _
        Public Property Voltage() As Double
            Get
                Return ViewModel.Model.Current.Voltage
            End Get
            Set(ByVal value As Double)
                ViewModel.Model.Current.Voltage = value

            End Set
        End Property


#End Region
    End Class

End Namespace